<% if @block.class.publishable? %>
    <div class="sidebar-block">
      <h4 class="gray">Status &nbsp; <%= draft_icon_tag(@block, force: true) %></h4>
    </div>
<% end %>
<% if @block.class.connectable? %>
    <div class="sidebar-block">
      <% if @block.connected_pages.empty? %>
          <h4 class="gray">Used on: <span class="dark right">Not attached to any page.</span></h4>
      <% else %>

          <ul class="unstyled">
            <h4 class="gray">Changes will affect:</h4>
            <% @block.connected_pages.each do |page| %>
                <li><%= link_to page.name, cms.page_path(page), target: "_blank" %></li>
            <% end %>
          </ul>
      <% end %>
<% if @block.respond_to?(:draft_version?) && !@block.draft_version? %>
    <h4>Version: v. <%= @block.version %> ( <%= link_to "Current", engine_aware_path(@block) %> )</h4>
<% end %>
</div>
<% end %>
<div class='sidebar-block'>
  <h4 class="gray">Actions</h4>
  <%=  yield :sidebar_actions if content_for(:sidebar_actions)%>
  <div class="btn-group">
    <%= link_to "View", engine_aware_path(@block), class: "btn btn-small" %>
    <%= link_to("Preview", @block.path, id: "preview_button", target: "_blank", class: "btn btn-small") if @block.class.addressable? %>
    <%= link_to "Versions", engine(@block).polymorphic_path([:versions, @block]), class: "btn btn-small" if @block.class.versioned? %>
  </div>
  <div class="btn-group">
    <%= link_to "Delete", engine_aware_path(@block), class: "btn btn-small btn-danger confirm_with_title http_delete", title: "Are you sure you want to delete this content?" %>
  </div>
</div>
<%= yield :sidebar_after if content_for(:sidebar_after)%>
